-- GENERATED SPELL FOR [7th Legion Siege Engineer] --


function spell0_27163(pUnit, Event) --@Place Scourge Discombobulater,n/a--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(49114,pUnit:GetMainTank ())
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_27163', 1, 1)
end

function spell1_27163(pUnit, Event) --@Self-Destruct,Self--
pUnit:FullCastSpellOnTarget(49215,pUnit)
pUnit:RegisterEvent('Sorts_27163', 10000, 1)
end

function Sorts_27163(pUnit, Event)
local choix_sorts_27163 = math.random(0, 1)
if choix_sorts_27163 == 0 then
pUnit:RegisterEvent('spell0_27163', 1, 1)
end
if choix_sorts_27163 == 1 then
pUnit:RegisterEvent('spell1_27163', 1, 1)
end
end

function mob27163_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_27163', math.random(1500, 3000), 1)
end

function mob27163_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob27163_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob27163_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(27163, 1, 'mob27163_Action')
RegisterUnitEvent(27163, 2, 'mob27163_Leave')
RegisterUnitEvent(27163, 3, 'mob27163_Kill')
RegisterUnitEvent(27163, 4, 'mob27163_Die')
